package com.blog.boot.custom.function;

import com.blog.boot.webapp.utils.CommonUtils;
import org.beetl.core.Context;
import org.beetl.core.Function;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;

public class SystemStamp implements Function {
    //一分钟
    private static final long ONEMINUTE = 60000;
    //三十分钟
    private static final long HALFHOUR = 1800000;
    //一小时
    private static final long ANHOUR = 3600000;

    @Override
    public Object call(Object[] objects, Context context) {
        Object object = objects[0];
        if( Objects.isNull(object) ){
            return "null";
        }
        return CommonUtils.getDatePoor(new Date((Long) object));
    }
}
